3.105 \(\int \frac {\cot ^2(e+f x)}{\sqrt {a+a \sin (e+f x)}} \, dx\)

Optimal. Leaf size=62 \[ \frac {\tanh ^{-1}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {a \sin (e+f x)+a}}\right )}{\sqrt {a} f}-\frac {\cot (e+f x)}{f \sqrt {a \sin (e+f x)+a}} \]

[Out]

arctanh(cos(f*x+e)*a^(1/2)/(a+a*sin(f*x+e))^(1/2))/f/a^(1/2)-cot(f*x+e)/f/(a+a*sin(f*x+e))^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.11, antiderivative size = 62, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.174, Rules used = {2716, 21, 2773, 206} \[ \frac {\tanh ^{-1}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {a \sin (e+f x)+a}}\right )}{\sqrt {a} f}-\frac {\cot (e+f x)}{f \sqrt {a \sin (e+f x)+a}} \]

Antiderivative was successfully verified.

[In]

Int[Cot[e + f*x]^2/Sqrt[a + a*Sin[e + f*x]],x]

[Out]

ArcTanh[(Sqrt[a]*Cos[e + f*x])/Sqrt[a + a*Sin[e + f*x]]]/(Sqrt[a]*f) - Cot[e + f*x]/(f*Sqrt[a + a*Sin[e + f*x]
])

Rule 21

Int[(u_.)*((a_) + (b_.)*(v_))^(m_.)*((c_) + (d_.)*(v_))^(n_.), x_Symbol] :> Dist[(b/d)^m, Int[u*(c + d*v)^(m +
 n), x], x] /; FreeQ[{a, b, c, d, n}, x] && EqQ[b*c - a*d, 0] && IntegerQ[m] && ( !IntegerQ[n] || SimplerQ[c +
 d*x, a + b*x])

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 2716

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)/tan[(e_.) + (f_.)*(x_)]^2, x_Symbol] :> -Simp[(a + b*Sin[e +
f*x])^m/(f*Tan[e + f*x]), x] + Dist[1/a, Int[((a + b*Sin[e + f*x])^m*(b*m - a*(m + 1)*Sin[e + f*x]))/Sin[e + f
*x], x], x] /; FreeQ[{a, b, e, f, m}, x] && EqQ[a^2 - b^2, 0] && IntegerQ[m - 1/2] &&  !LtQ[m, -1]

Rule 2773

Int[Sqrt[(a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]]/((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[(-2*
b)/f, Subst[Int[1/(b*c + a*d - d*x^2), x], x, (b*Cos[e + f*x])/Sqrt[a + b*Sin[e + f*x]]], x] /; FreeQ[{a, b, c
, d, e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0]

Rubi steps

\begin {align*} \int \frac {\cot ^2(e+f x)}{\sqrt {a+a \sin (e+f x)}} \, dx &=-\frac {\cot (e+f x)}{f \sqrt {a+a \sin (e+f x)}}+\frac {\int \frac {\csc (e+f x) \left (-\frac {a}{2}-\frac {1}{2} a \sin (e+f x)\right )}{\sqrt {a+a \sin (e+f x)}} \, dx}{a}\\ &=-\frac {\cot (e+f x)}{f \sqrt {a+a \sin (e+f x)}}-\frac {\int \csc (e+f x) \sqrt {a+a \sin (e+f x)} \, dx}{2 a}\\ &=-\frac {\cot (e+f x)}{f \sqrt {a+a \sin (e+f x)}}+\frac {\operatorname {Subst}\left (\int \frac {1}{a-x^2} \, dx,x,\frac {a \cos (e+f x)}{\sqrt {a+a \sin (e+f x)}}\right )}{f}\\ &=\frac {\tanh ^{-1}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {a+a \sin (e+f x)}}\right )}{\sqrt {a} f}-\frac {\cot (e+f x)}{f \sqrt {a+a \sin (e+f x)}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B]  time = 0.32, size = 138, normalized size = 2.23 \[ \frac {\left (\tan \left (\frac {1}{2} (e+f x)\right )+1\right ) \csc \left (\frac {1}{4} (e+f x)\right ) \sec \left (\frac {1}{4} (e+f x)\right ) \left (2 \sin \left (\frac {1}{2} (e+f x)\right )-2 \cos \left (\frac {1}{2} (e+f x)\right )+\sin (e+f x) \left (\log \left (-\sin \left (\frac {1}{2} (e+f x)\right )+\cos \left (\frac {1}{2} (e+f x)\right )+1\right )-\log \left (\sin \left (\frac {1}{2} (e+f x)\right )-\cos \left (\frac {1}{2} (e+f x)\right )+1\right )\right )\right )}{8 f \sqrt {a (\sin (e+f x)+1)}} \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[e + f*x]^2/Sqrt[a + a*Sin[e + f*x]],x]

[Out]

(Csc[(e + f*x)/4]*Sec[(e + f*x)/4]*(-2*Cos[(e + f*x)/2] + 2*Sin[(e + f*x)/2] + (Log[1 + Cos[(e + f*x)/2] - Sin
[(e + f*x)/2]] - Log[1 - Cos[(e + f*x)/2] + Sin[(e + f*x)/2]])*Sin[e + f*x])*(1 + Tan[(e + f*x)/2]))/(8*f*Sqrt
[a*(1 + Sin[e + f*x])])

________________________________________________________________________________________

fricas [B]  time = 0.43, size = 263, normalized size = 4.24 \[ \frac {{\left (\cos \left (f x + e\right )^{2} - {\left (\cos \left (f x + e\right ) + 1\right )} \sin \left (f x + e\right ) - 1\right )} \sqrt {a} \log \left (\frac {a \cos \left (f x + e\right )^{3} - 7 \, a \cos \left (f x + e\right )^{2} + 4 \, {\left (\cos \left (f x + e\right )^{2} + {\left (\cos \left (f x + e\right ) + 3\right )} \sin \left (f x + e\right ) - 2 \, \cos \left (f x + e\right ) - 3\right )} \sqrt {a \sin \left (f x + e\right ) + a} \sqrt {a} - 9 \, a \cos \left (f x + e\right ) + {\left (a \cos \left (f x + e\right )^{2} + 8 \, a \cos \left (f x + e\right ) - a\right )} \sin \left (f x + e\right ) - a}{\cos \left (f x + e\right )^{3} + \cos \left (f x + e\right )^{2} + {\left (\cos \left (f x + e\right )^{2} - 1\right )} \sin \left (f x + e\right ) - \cos \left (f x + e\right ) - 1}\right ) + 4 \, \sqrt {a \sin \left (f x + e\right ) + a} {\left (\cos \left (f x + e\right ) - \sin \left (f x + e\right ) + 1\right )}}{4 \, {\left (a f \cos \left (f x + e\right )^{2} - a f - {\left (a f \cos \left (f x + e\right ) + a f\right )} \sin \left (f x + e\right )\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^2/(a+a*sin(f*x+e))^(1/2),x, algorithm="fricas")

[Out]

1/4*((cos(f*x + e)^2 - (cos(f*x + e) + 1)*sin(f*x + e) - 1)*sqrt(a)*log((a*cos(f*x + e)^3 - 7*a*cos(f*x + e)^2
 + 4*(cos(f*x + e)^2 + (cos(f*x + e) + 3)*sin(f*x + e) - 2*cos(f*x + e) - 3)*sqrt(a*sin(f*x + e) + a)*sqrt(a)
- 9*a*cos(f*x + e) + (a*cos(f*x + e)^2 + 8*a*cos(f*x + e) - a)*sin(f*x + e) - a)/(cos(f*x + e)^3 + cos(f*x + e
)^2 + (cos(f*x + e)^2 - 1)*sin(f*x + e) - cos(f*x + e) - 1)) + 4*sqrt(a*sin(f*x + e) + a)*(cos(f*x + e) - sin(
f*x + e) + 1))/(a*f*cos(f*x + e)^2 - a*f - (a*f*cos(f*x + e) + a*f)*sin(f*x + e))

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: NotImplementedError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^2/(a+a*sin(f*x+e))^(1/2),x, algorithm="giac")

[Out]

Exception raised: NotImplementedError >> Unable to parse Giac output: Unable to check sign: (4*pi/x/2)>(-4*pi/
x/2)Unable to check sign: (4*pi/x/2)>(-4*pi/x/2)Unable to check sign: (4*pi/x/2)>(-4*pi/x/2)Unable to check si
gn: (4*pi/x/2)>(-4*pi/x/2)Unable to check sign: (4*pi/x/2)>(-4*pi/x/2)Unable to check sign: (4*pi/x/2)>(-4*pi/
x/2)Unable to check sign: (4*pi/x/2)>(-4*pi/x/2)Unable to check sign: (4*pi/x/2)>(-4*pi/x/2)2/f*(1/4*sqrt(a*ta
n((f*x+exp(1))/2)^2+a)/sign(tan((f*x+exp(1))/2)+1)/a+2*(1/4*sqrt(a)/((-sqrt(a)*tan((f*x+exp(1))/2)+sqrt(a*tan(
(f*x+exp(1))/2)^2+a))^2-a)/sign(tan((f*x+exp(1))/2)+1)-1/4*atan((-sqrt(a)*tan((f*x+exp(1))/2)+sqrt(a*tan((f*x+
exp(1))/2)^2+a))/sqrt(-a))/sqrt(-a)/sign(tan((f*x+exp(1))/2)+1)+1/8*sqrt(a)*ln(abs(-sqrt(a)*tan((f*x+exp(1))/2
)+sqrt(a*tan((f*x+exp(1))/2)^2+a)))/a/sign(tan((f*x+exp(1))/2)+1))+(-sqrt(-a)*sqrt(2)*ln(sqrt(2)*sqrt(a)+sqrt(
a))-sqrt(-a)*sqrt(2)-sqrt(-a)*ln(sqrt(2)*sqrt(a)+sqrt(a))-3*sqrt(-a)+2*sqrt(2)*sqrt(a)*atan((sqrt(2)*sqrt(a)+s
qrt(a))/sqrt(-a))+2*sqrt(a)*atan((sqrt(2)*sqrt(a)+sqrt(a))/sqrt(-a)))/(4*sqrt(-a)*sqrt(2)*sqrt(a)+4*sqrt(-a)*s
qrt(a))*sign(tan((f*x+exp(1))/2)+1))

________________________________________________________________________________________

maple [A]  time = 0.69, size = 103, normalized size = 1.66 \[ -\frac {\left (1+\sin \left (f x +e \right )\right ) \sqrt {-a \left (\sin \left (f x +e \right )-1\right )}\, \left (-\arctanh \left (\frac {\sqrt {a -a \sin \left (f x +e \right )}}{\sqrt {a}}\right ) a \sin \left (f x +e \right )+\sqrt {a -a \sin \left (f x +e \right )}\, \sqrt {a}\right )}{a^{\frac {3}{2}} \sin \left (f x +e \right ) \cos \left (f x +e \right ) \sqrt {a +a \sin \left (f x +e \right )}\, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(f*x+e)^2/(a+a*sin(f*x+e))^(1/2),x)

[Out]

-(1+sin(f*x+e))*(-a*(sin(f*x+e)-1))^(1/2)*(-arctanh((a-a*sin(f*x+e))^(1/2)/a^(1/2))*a*sin(f*x+e)+(a-a*sin(f*x+
e))^(1/2)*a^(1/2))/a^(3/2)/sin(f*x+e)/cos(f*x+e)/(a+a*sin(f*x+e))^(1/2)/f

________________________________________________________________________________________

maxima [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\cot \left (f x + e\right )^{2}}{\sqrt {a \sin \left (f x + e\right ) + a}}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^2/(a+a*sin(f*x+e))^(1/2),x, algorithm="maxima")

[Out]

integrate(cot(f*x + e)^2/sqrt(a*sin(f*x + e) + a), x)

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.02 \[ \int \frac {{\mathrm {cot}\left (e+f\,x\right )}^2}{\sqrt {a+a\,\sin \left (e+f\,x\right )}} \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(e + f*x)^2/(a + a*sin(e + f*x))^(1/2),x)

[Out]

int(cot(e + f*x)^2/(a + a*sin(e + f*x))^(1/2), x)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\cot ^{2}{\left (e + f x \right )}}{\sqrt {a \left (\sin {\left (e + f x \right )} + 1\right )}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)**2/(a+a*sin(f*x+e))**(1/2),x)

[Out]

Integral(cot(e + f*x)**2/sqrt(a*(sin(e + f*x) + 1)), x)

________________________________________________________________________________________